<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <#assign base=request.contextPath  />
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="../frame/layui/css/layui.css">
    <link rel="stylesheet" href="../frame/static/css/style.css">
    <link rel="icon" href="../frame/static/image/code.png">
    <script type="text/javascript" src="../frame/layui/layui.all.js"></script>
    <script type="text/javascript" src="${base}/js/zhang.js"></script>
    <script type="text/javascript" src="../frame/layui/layui.all.js"></script>
    <script src="${base}/js/jquery-1.8.3.min.js"></script>
    <style type="text/css">
        .layui-form-select dl dd.layui-this {
            background-color: #1E9FFF;
            color: #fff;
        }
        img{
            width: 160px;
            height: 110px;
        }
    </style>
</head>
<body class="body">

<form class="layui-form" action="">

    <input type="hidden" id="id"/>
    <div class="layui-form-item">
        <label class="layui-form-label"><a style="color: red">*</a>&nbsp;已认证企业</label>
        <div class="layui-input-block">
            <input  lay-verify="required" placeholder="请输入已认证企业" class="layui-input isNull" id="ptName">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;企业姓名</label>
            <div class="layui-input-inline">
                <input lay-verify="required"  placeholder="企业姓名" class="layui-input isNull" id="callName">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;车辆品牌</label>
            <div class="layui-input-inline">
                <input lay-verify="required"  placeholder="请输入车辆品牌" class="layui-input isNull" id="carBrand">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;联系人手机</label>
            <div class="layui-input-inline">
                <input type="tel" name="phone" placeholder="请输入联系人手机号" lay-verify="required|Phone|number" class="layui-input isPhone isNum" id="callPhone">
            </div>
        </div>

    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;车型</label>
            <div class="layui-input-inline">
                <input lay-verify="required" placeholder="请输入车型"  class="layui-input isNull" id="carType">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;数量</label>
            <div class="layui-input-inline">
                <input lay-verify="required" placeholder="请输入数量"  class="layui-input isNull" id="num">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><a style="color: red">*</a>&nbsp;是否有运营证</label>
            <#--<div class="layui-input-inline">-->
                <#--<input lay-verify="required"  placeholder="请输入是否有运营证" class="layui-input isNull" id="getsuitation">-->
            <#--</div>-->
            <div class="layui-input-block">
                <select name="certificate" lay-filter="" id="certificate">
                    <option value="2">没有</option>
                    <option value="1" selected="">有</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">显示图</label>
        <div class="layui-input-block" style="width: 100%;">
            <img src="${base}/comCar/getPhoto?path=${peoepleUrla}"/>
        </div>
    </div>
    <#--<div class="layui-form-item">-->
        <#--<label class="layui-form-label">轮播图</label>-->
        <#--<div class="layui-input-block" style="width: 100%;">-->
            <#--<img src="${base}/comCar/getPhoto?path=${peoepleUrlb}"/>-->
        <#--</div>-->
    <#--</div>-->
    <label class="layui-form-label">轮播图</label>
        <#list  photos as list>

			<div class="layui-form-item">
                <div class="layui-input-block" style="width: 100%;">
                        <img src="${base}/comCar/getPhoto?path=${list.url}"/>
                    </div>

                </div>

        </#list>
    <div class="layui-form-item">
        <label class="layui-form-label">是否通过</label>
        <div class="layui-input-block">
            <select name="interest" lay-filter="" id="isShow">
                <option value="2">不通过</option>
                <option value="1" selected="">通过</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">不通过原因</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入内容" class="layui-textarea" id="cause"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="demo1" type="button" onclick="check()">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="../frame/layui/layui.all.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;


        //监听提交
        // form.on('submit(demo1)', function(data){
        //   layer.alert(JSON.stringify(data.field), {
        //     title: '最终的提交信息'
        //   })
        //   return false;
        // });

    });
    //修改
    function check() {
        if (!isPhone()){
            return;
        }
        if(!isNull()){
            return;
        }
        if(!isNum()){
            return;
        }
        var jsonDate = {};
        jsonDate.ptname = $("#ptName").val();
        jsonDate.callName = $("#callName").val();
        jsonDate.callPhone = $("#callPhone").val();
        jsonDate.carType = $("#carType").val();
        jsonDate.id = $("#id").val();
        jsonDate.num = $("#num").val();
        jsonDate.isShow = $("#isShow").val();
        jsonDate.cause = $("#cause").val();
         jsonDate.carBrand = $("#carBrand").val();
        jsonDate.certificate = $("#certificate").val();
        $.ajax({
            type: "POST",
            url: "${base}/comCar/updatecheck",
            data: {"param": JSON.stringify(jsonDate)},
            success: function (data) {
                if(data){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                    parent.location.reload();
                }


            }
        })
    }


</script>
</body>
</html>